/*************************************************************************
	> File Name: 083.deleteDuplicates.c
	> Author: Maureen 
	> Mail: Maureen@qq.com 
	> Created Time: 四  9/ 2 17:12:29 2021
 ************************************************************************/

/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     struct ListNode *next;
 * };
 */


struct ListNode* deleteDuplicates(struct ListNode* head){
    if (head == NULL || head->next == NULL) return head;
    struct ListNode *p = head;
    while (p->next) {
        if (p->next->val == p->val) {
            p->next = p->next->next;
        } else {
            p = p->next;
        }
    }
    return head;
}
